home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-01 | 2.6 KB | 61 lines | [TEXT/R*ch] |
- /***
- *
- * UnDumpFile.cp - MPW tool to rebuild a binary file from a hex dump
- * Copyright © Christopher E. Hyde, 1994. All rights reserved.
- *
- * Version: 1.01
- * Usage: UnDumpFile -o outputFile [inputFiles...]
- *
- ***/
-
- /*
- DESCRIPTION:
- This simple MPW tool written in C++ creates a binary data file by reading the hexidecimal
- byte codes in a file created by the MPW tool 'DumpFile'. This allows a binary file to be
- 'dumped' edited (by inserting or removing hex bytes) and then 'undumped'.
-
- USAGE:
- The command line is of the form:
- UnDumpFile -o outputFile [inputFiles...]
- The input files are effectively concatenated together and then parsed to form the
- output file.
-
- Often followed by a command line of the form:
- SetFile -c 'crea' -t 'type' outputFile
-
- Lines in the input file are expected to be of the form:
- <Address> ':' <Hex Byte Codes> <ASCII Chars>
- or more precisely:
- spc* hex+ ':' <' ' hex hex>«1,16» [spc+ ?*]
- Any optional whitespace, followed by 1 or more hex digits, followed by a colon, followed
- by between 1 and 16 space-hexdigit-hexdigit sequences, optionally followed by a whitespace
- and any characters up to a caridge return. The maximum line length is 256 caracters.
- Lines that are not of this form are ignored. The <Address> and <ASCII Chars> are also
- ignored. Therefore lines could be commented out by placing a '#' at the start. And
- lines may be inserted by placing something such as '0: F1 E2 D3 ...' on a line between
- any other lines. Individual bytes may be removed by deleting the appropriate hex code
- (and preceeding space). Individual bytes may be inserted by splitting a line into two
- and adding '0: ' at the begining of the second (to maintain the correct form).
-
- NOTE: If a line contains less than 16 hex bytes followed by exactly one space followed by
- 2 hex digits (from the <ASCII Chars> to the right) then this will be interpreted as an
- additional data byte. Also each <Hex Byte Code> must be separated by exactly one space
- from the previous one. These problems may only occur in an edited line.
-
- NB. Hex bytes are specified by pairs of characters that are either the digits '0' to '9'
- or the upper-case letters 'A' to 'F'. The lower-case letters 'a' to 'f' are not accepted.
- The modification of the program to accept these characters is left as an exercise to the
- user ;-)
-
- CONTACTING THE AUTHOR:
- Bug reports, suggestions, comments, thanks, congratulations and currency bills of any
- denomination will be gratefully accepted by the author.
-
- Internet: drjekyll@hylight.demon.co.uk
- Post: Christopher E. Hyde
- HyLight Limited
- 25 Carson Road
- London E16 4BD
- England (UK)
- */
-